#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //创建一个新的动作
    QAction * openAction = new QAction((tr("&open")),this);
    //添加icon
    QIcon icon(":/myimages/images/open.jpg");
    openAction->setIcon(icon);
    //设置快捷键
    openAction->setShortcut(QKeySequence(tr("Ctrl+0")));
    //添加到菜单栏中
    ui->menu_F->addAction(openAction);



    //创建一个新的主菜单
    QMenu * menu_E =ui->menuBar->addMenu((tr("编辑(&E)")));
    //创建一个新的动作
    QAction * findAction = new QAction((tr("&find")),this);
    //添加icon
    QIcon icon2(":/myimages/images/find.jpg");
    openAction->setIcon(icon2);
    //设置快捷键
    findAction->setShortcut(QKeySequence(tr("Ctrl+F")));
    //添加到菜单栏中
    menu_E->addAction(findAction);


}

MainWindow::~MainWindow()
{
    delete ui;
}
